<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="div1" style="width: 500px;height: 500px;background-color: red"></div>
    <script src="js/外观模式.js"></script>
    <script>
        addMyEvent(document.getElementById("div1"),"click",function () {
            alert("123");
        })
    </script>
</body>
</html>